package com.sahyadri.web.bean;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;



@Entity
@Table(name = "ORGANIZATION")
public class Organization implements Serializable{
	
	
	private static final long serialVersionUID = 1697268027619725187L;
	public Organization(){
		super();
	}
	public Organization(long orgId, String orgName) {
		super();
		this.id = orgId;
		this.name = orgName;
	}
	
	@Id
	@GeneratedValue
    private long id;
	
	private String name;
	
	
	@OneToMany(fetch = FetchType.LAZY)
	@JoinColumn(name="Org_Id", nullable = false)
	private Set<Location> locations;
	
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	public Set<Location> getLocations() {
		return locations;
	}
	
	
	public void setLocations(Set<Location> locations) {
		this.locations = locations;
	}
	
	
	
	

}
